package com.yycwxt.modules.admin.cgj_xscb_gdpdk.xsckmxcb;

import com.yycwxt.modules.admin.data_import.ImpFile;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.time.LocalDateTime;
import java.util.List;

/**
 * Created by Mr.Zhang on 2022/9/16 11:01
 */
@Mapper
public interface ImpXsckcbMapper {

    @Select("""
            select b.id, a.value name, b.filename, b.zq, b.url, b.remark, b.created
            from (select distinct value from sys_dictionary where name='文件清单') a
            left outer join imp_files b on a.value = b.name and b.zq = #{zq}
            """)
    public List<ImpFile> selectImpFiles(@Param("zq") Integer zq);

    // 调用销售成本明细存储过程
    @Select("""
            call impXsckcb(
                #{zq,mode=IN,jdbcType=INTEGER},
                #{ddbh,mode=IN,jdbcType=VARCHAR},
                #{ck,mode=IN,jdbcType=VARCHAR},
                #{dp,mode=IN,jdbcType=VARCHAR},
                #{sjbm,mode=IN,jdbcType=VARCHAR},
                #{hpmc,mode=IN,jdbcType=VARCHAR},
                #{hpsl,mode=IN,jdbcType=INTEGER},
                #{fhsj,mode=IN,jdbcType=TIMESTAMP}
                );
            """)
    public void impXsckmxcb(Integer zq, String ddbh, String ck, String dp, String sjbm, String hpmc, Integer hpsl,
                            LocalDateTime fhsj);
}
